
/*
public class WySpecialtyProxy {
    public static void main(String[] args) {
        SgProxy proxy = new SgProxy();
        proxy.display();
    }
}

//抽象主题
interface Specialty{
    void display();
}

//真是主题
class WySpecialty implements Specialty{
    
    String name;

    public WySpecialty(){
        //super("代理测试");
        this.name = "女神一号";
    }

    public void display(){
        System.out.println("i am "+name);
    }
}

//代理
class SgProxy implements Specialty{
    private WySpecialty rSpecialty = new WySpecialty();

    public void display(){
        preRequest();
        rSpecialty.display();
        postRequest();
    }

    public void preRequest(){
        System.out.println("代理开始");
    }

    public void postRequest(){
        System.out.println("代理结束");
    }
}*/